<template>
  <div>
  <el-table
    :data="tableData"
    row-key="id"
    border
    :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
    class="myTab">
    <el-table-column
     label="区域名称" 
     prop="name">
    </el-table-column>
    <el-table-column
    label="区域类型"
     prop="type">
    </el-table-column>
    <el-table-column
      label="区域编码"
       prop="code">
    </el-table-column>
  </el-table>
  </div>
</template>
  
<script>
import axios from 'axios'

export default {
  name: 'administrativeRegion',
  componentTitle: '行政区域',
  data () {
    return {
      tableData:[]

    }
  },
  mounted(){
this.getData()
  },
  methods:{
    getData(){
        axios({
        url: 'http://192.168.200.251:8888/admin/region/list',
        method: 'get',
        headers: {
          'Shopping-Admin-Token': sessionStorage.getItem('Shopping-Admin-Token')
        }
      }).then(res => {
        console.log(res)
        this.tableData=res.data.data.list
      })
    }
  }
}
</script>
<style lang="scss" scoped>

.myTab{
  width: 95%;
  text-align: center;
  margin: 0 auto;
  margin-top: 30px;
  height: 100%;
}
</style>
